

import 'short_model.dart';

class UserModel{
  String? id;
  String? userCode;
  String? userName;
  String? firstName;
  String? lastName;
  String? photo;
  String? company;
  String? jobTitle;
  String? email;
  int? state;
  String? stateName;
  ShortModel? group;
  ShortModel? proj;
  bool? admin;

  UserModel(
      {this.id,
        this.userCode,
        this.userName,
        this.email,
        this.state,
        this.stateName,
        this.group,
        this.proj,
        this.admin});

  UserModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    userCode = json['userCode'];
    userName = json['userName'];
    email = json['email'];
    state = json['state'];
    stateName = json['stateName'];
    admin = json['admin'];
    group = json['group'] != null ? ShortModel.fromJson(json['group']) : null;
    proj = json['proj'] != null ? ShortModel.fromJson(json['proj']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['userCode'] = this.userCode;
    data['userName'] = this.userName;
    data['email'] = this.email;
    data['state'] = this.state;
    data['stateName'] = this.stateName;
    data['admin'] = this.admin;
    if (this.group != null) {
      data['group'] = this.group!.toJson();
    }
    if (this.proj != null) {
      data['proj'] = this.proj!.toJson();
    }
    return data;
  }
}